com.atlassian.jira.rpc.soap.util
Class PluginSoapAttachmentHelper

java.lang.Object
  extended by com.atlassian.jira.rpc.soap.util.PluginSoapAttachmentHelper

public class PluginSoapAttachmentHelper
extends java.lang.Object


Field Summary
private  java.lang.String attachmentsDir
           
private static Logger log
           
private static java.lang.String UNKOWN_FILE
           
 
Constructor Summary
PluginSoapAttachmentHelper()
           
 
Method Summary
 java.lang.String[] addFiles(Stub stub, java.lang.String[] fileLocations)
          This method is used for adding files as attachments for SOAP calls
 java.io.File byteArrayToTempFile(byte[] buffer)
           
 javax.activation.DataHandler[] getDataHandlers()
           
static PluginSoapAttachmentHelper getInstance()
           
private  AttachmentPart[] getMessageAttachments()
          extract attachments from the current request
 void relayAttachments(Stub stub)
           
 java.io.File[] saveFile(java.lang.String[] attachmentFileNames)
          This method receives the attachment from the client and saves it on the temp directory on the server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final Logger log

attachmentsDir

private final java.lang.String attachmentsDir

UNKOWN_FILE

private static final java.lang.String UNKOWN_FILE
See Also:
Constant Field Values
Constructor Detail

PluginSoapAttachmentHelper

public PluginSoapAttachmentHelper()
Method Detail

addFiles

public java.lang.String[] addFiles(Stub stub,
                                   java.lang.String[] fileLocations)
This method is used for adding files as attachments for SOAP calls

Parameters:
stub - THe Axis SOAP stub generated by Axis
fileLocations - list of files to be attached from the local client file system
Returns:
attachment file names

saveFile

public java.io.File[] saveFile(java.lang.String[] attachmentFileNames)
                        throws java.rmi.RemoteException
This method receives the attachment from the client and saves it on the temp directory on the server

Parameters:
attachmentFileNames - scontaining the file names of the attachments.
Returns:
File[] containing the File objects of the attachments.
Throws:
java.rmi.RemoteException

relayAttachments

public void relayAttachments(Stub stub)
                      throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getDataHandlers

public javax.activation.DataHandler[] getDataHandlers()

getMessageAttachments

private AttachmentPart[] getMessageAttachments()
                                        throws AxisFault
extract attachments from the current request

Returns:
a list of attachmentparts or an empty array for no attachments support in this axis buid/runtime
Throws:
AxisFault

getInstance

public static PluginSoapAttachmentHelper getInstance()

byteArrayToTempFile

public java.io.File byteArrayToTempFile(byte[] buffer)